<div id="content_header">
  <h3>Create a new Course Schedule</h3>
</div>

<div class="row">
  <form name="courseScheduleForm" role="form" ng-submit="addCourseSchedule()">

    <div class="form-group">
      <label for="TermId">
        Term
      </label>
      <select name="TermId" class="form-control" id="TermId" ng-model="courseScheduleNew.Term.Id" ng-options="term.Id as formatTerm(term) group by term.Year for term in terms" required>
        <option value="" ng-hide="courseScheduleNew.Term.Id">Select Term.</option>
      </select>
    </div>

    <div class="form-group">
      <label for="TimeClassId">
        Time
      </label>
      <select name="TimeClassId" class="form-control" id="TimeClassId" ng-model="courseScheduleNew.TimeClass.Id" ng-options="timeclass.Id as label(timeclass.StartTime, timeclass.EndTime) for timeclass in timeclasses" required>
        <option value="" ng-hide="courseScheduleNew.TimeClass.Id">Select Time.</option>
      </select>
    </div>

    <div class="form-group">
      <label for="DayClassId">
        Day
      </label>
      <select name="DayClassId" class="form-control" id="DayClassId" ng-model="courseScheduleNew.DayClass.Id" ng-options="dayclass.Id as dayclass.DayRange for dayclass in dayclasses" required>
        <option value="" ng-hide="courseScheduleNew.DayClass.Id">Select Day.</option>
      </select>
    </div>

    <div class="form-group">
      <label for="ClassroomId">
        Class
      </label>
      <select name="ClassroomId" class="form-control" id="ClassroomId" ng-model="courseScheduleNew.Classroom.Id" ng-options="classroom.Id as classroom.Name for classroom in classrooms" required>
        <option value="" ng-hide="courseScheduleNew.Classroom.Id">Select Class.</option>
      </select>
    </div>

    <div class="form-group">
      <label for="CourseId">
        Course
      </label>
      <select name="CourseId" class="form-control" id="CourseId" ng-model="courseScheduleNew.Course.Id" ng-options="course.Id as course.Code +' - '+ course.CourseName for course in courses" required>
        <option value="" ng-hide="courseScheduleNew.Course.Id">Select Course.</option>
      </select>
    </div>

    <button type="submit" class="btn btn-primary" >Submit</button>
  </form>
</div>